﻿<div id="main">
    <div id="contents">
        <form method="post" action="#" name="filters">
            <fieldset>
                <legend>
                    <label sid="tone.title"></label>
                </legend>
                <div class="frame_tab_layer">
                    <table class="cmenutitle" width="100%" cellspacing="0" cellpadding="0" border="0">
                        <tbody>
                        <tr width="100%">
                            <td class="frame_tab_left" width="33%">
                                <label sid="tone.td1"></label>
                            </td>
                            <td class="frame_tab_right" width="67%">
                                <select id="id179" style="width:150px;" name="id179"> </select>
                                <span style="padding-left:10px;">&nbsp;</span>
                            </td>
                        </tr>
                        <tr id="tr144" width="100%">
                            <td class="frame_tab_left">
                                <label sid="tone.td2"></label>
                            </td>
                            <td id="td144" class="frame_tab_right">
                                <input class="step-tone" type="text" name="id144" size="40">
                                <span id="msg144">&nbsp;</span>
                            </td>
                        </tr>
                        <tr id="tr148" width="100%">
                            <td class="frame_tab_left">
                                <label sid="tone.td3"></label>
                            </td>
                            <td id="td148" class="frame_tab_right">
                                <input class="step-tone" type="text" name="id148" size="40">
                                <span id="msg148">&nbsp;</span>
                            </td>
                        </tr>
                        <tr id="tr149" width="100%">
                            <td class="frame_tab_left">
                                <label sid="tone.td4"></label>
                            </td>
                            <td id="td149" class="frame_tab_right">
                                <input class="step-tone" type="text" name="id149" size="40">
                                <span id="msg149">&nbsp;</span>
                            </td>
                        </tr>
                        <tr id="tr147" width="100%">
                            <td class="frame_tab_left">
                                <label sid="tone.td5"></label>
                            </td>
                            <td id="td147" class="frame_tab_right">
                                <input class="step-tone" type="text" name="id147" size="40">
                                <span id="msg147">&nbsp;</span>
                            </td>
                        </tr>
                        <tr id="tr150" width="100%">
                            <td class="frame_tab_left">
                                <label sid="tone.td6"></label>
                            </td>
                            <td id="td150" class="frame_tab_right">
                                <input class="step-tone" type="text" name="id150" size="40">
                                <span id="msg150">&nbsp;</span>
                            </td>
                        </tr>
                        <tr id="tr145" width="100%">
                            <td class="frame_tab_left">
                                <label sid="tone.td7"></label>
                            </td>
                            <td id="td145" class="frame_tab_right">
                                <input class="step-tone" type="text" name="id145" size="40">
                                <span id="msg145">&nbsp;</span>
                            </td>
                        </tr>
                        <tr id="tr151" width="100%">
                            <td class="frame_tab_left">
                                <label sid="tone.td8"></label>
                            </td>
                            <td id="td151" class="frame_tab_right">
                                <input class="step-tone" type="text" name="id151" size="40">
                                <span id="msg151">&nbsp;</span>
                            </td>
                        </tr>
                        <tr id="tr146" width="100%">
                            <td class="frame_tab_left">
                                <label sid="tone.td9"></label>
                            </td>
                            <td id="td146" class="frame_tab_right">
                                <input class="step-tone" type="text" name="id146" size="40">
                                <span id="msg146">&nbsp;</span>
                            </td>
                        </tr>
                        <tr id="tr152" width="100%">
                            <td class="frame_tab_left" height="20">
                                <label sid="tone.td10"></label>
                            </td>
                            <td id="td152" class="frame_tab_right">
                                <input class="step-tone" type="text" name="id152" size="40">
                                <span id="msg152">&nbsp;</span>
                            </td>
                        </tr>
                        </tbody>
                    </table>
                </div>
            </fieldset>

            <div class="submitFooter">
                <script type="text/javascript">
                    var buttonInfo = submitFooterButton(1,0);
                    $(".submitFooter").html(buttonInfo);
                </script>
            </div>
        </form>
    </div>
</div>
<br>
<div id="helpContainer">
    <div id="help">
        <div>
            <h2>
                <label sid="share.help"></label>
            </h2>
        </div>
        <div id="helpBody">
            <dl>

                <dt class="term">
                    <label sid="tone.td2"></label>
                </dt>
                <dd class="definition">
                    <label sid="tone.td2Tip"></label>
                </dd>

                <dt class="term">
                    <label sid="tone.td3"></label>
                </dt>
                <dd class="definition">
                    <label sid="tone.td3Tip"></label>
                </dd>

                <dt class="term">
                    <label sid="tone.td4"></label>
                </dt>
                <dd class="definition">
                    <label sid="tone.td4Tip"></label>
                </dd>

                <dt class="term">
                    <label sid="tone.td5"></label>
                </dt>
                <dd class="definition">
                    <label sid="tone.td5Tip"></label>
                </dd>

                <dt class="term">
                    <label sid="tone.td6"></label>
                </dt>
                <dd class="definition">
                    <label sid="tone.td6Tip"></label>
                </dd>

                <dt class="term">
                    <label sid="tone.td7"></label>
                </dt>
                <dd class="definition">
                    <label sid="tone.td7Tip"></label>
                </dd>

                <dt class="term">
                    <label sid="tone.td8"></label>
                </dt>
                <dd class="definition">
                    <label sid="tone.td8Tip"></label>
                </dd>
                <dt class="term">
                    <label sid="tone.td9"></label>
                </dt>
                <dd class="definition">
                    <label sid="tone.td9Tip"></label>
                </dd>
                <dt class="term">
                    <label sid="tone.td10"></label>
                </dt>
                <dd class="definition">
                    <label sid="tone.td10Tip"></label>
                </dd>

            </dl>
            <br>
            <a href="javascript:openHelpWindow('tone_help.htm?language='+getQueryStr('language'));">
                <img border="0" src="images/more.png">
            </a>
        </div>
    </div>
</div>

<script type="text/javascript">


        var nonames=new Array('submit','id179');
        updtonecfg();
        $("[name=id179]").click(function () {
            change179(nonames);
        });



function updtonecfg() {
	var url='/xml?method=gw.config.get&id=4016&id=179&tmp='+Math.random();
	$.get(url,function (data) {
		var country_id='';
		$(data).find('item').each(function () {
			if($(this).attr("id")=="179") {
				country_id=$(this).attr('value');
				if(!country_id) {
					gotologin();
				}
				var gettext="&id=144&id=145&id=146&id=147&id=148&id=149&id=150&id=151&id=152";
				gettext='&country_id='+country_id+gettext;
				DataRequest("get_json",gettext,function(data){
  					getResult(nonames,data);
  				});
			}
		});
		$(data).find('value').each(function () {
			var strArray=$(this).text().split("/");
				if(strArray[1]==86) {
					strArray[0]=tone.country1;
				}if(strArray[1]==1) {
					strArray[0]=tone.country2;
				}if(strArray[1]==33) {
					strArray[0]=tone.country3;
				}if(strArray[1]==39) {
					strArray[0]=tone.country4;
				}if(strArray[1]==49) {
					strArray[0]=tone.country5;
				}if(strArray[1]==52) {
					strArray[0]=tone.country6;
				}if(strArray[1]==56) {
					strArray[0]=tone.country7;
				}if(strArray[1]==7) {
					strArray[0]=tone.country8;
				}if(strArray[1]==81) {
					strArray[0]=tone.country9;
				}if(strArray[1]==82) {
					strArray[0]=tone.country10;
				}if(strArray[1]==852) {
					strArray[0]=tone.country11;
				}if(strArray[1]==886) {
					strArray[0]=tone.country12;
				}if(strArray[1]==91) {
					strArray[0]=tone.country13;
				}if(strArray[1]==249) {
					strArray[0]=tone.country14;
				}if(strArray[1]==98) {
					strArray[0]=tone.country15;
				}if(strArray[1]==213) {
					strArray[0]=tone.country16;
				}if(strArray[1]==92) {
					strArray[0]=tone.country17;
				}if(strArray[1]==63) {
					strArray[0]=tone.country18;
				}if(strArray[1]==327) {
					strArray[0]=tone.country19;
				}if(strArray[1]==1000) {
					strArray[0]=tone.country20;
				}
			if(strArray[1]==country_id) {
				$("<option value="+strArray[1]+" selected>"+strArray[0]+"</option>").appendTo("select[name=id179]");
			}else {
				$("<option value="+strArray[1]+">"+strArray[0]+"</option>").appendTo("select[name=id179]");
			}
		});
		read();
	});
	
	$("[name=submit]").click(function () {
		$(".errormsg").html('');
		var settext='';
		if($("[name=id179]").val()=='1000') {
			settext+="&id179=1000";
			$(":input").each(function () {
				if(checkname(nonames,$(this).attr('name'))) {
					var postvalue=$.trim($(this).val());
					var sendname=$(this).attr('name');
					if($(this).attr('type')=='checkbox') {
						var postvalue=gettruevalue($(this).attr('name'),postvalue);
					}if($(this).attr('type')=='radio') {
						if($(this).attr('checked')) {
							settext+="&"+sendname+"="+postvalue;
						}
					}else {
						postvalue=postvalue.replace(/\#/g,"%23");
						settext+="&"+sendname+"="+postvalue;
					}
				}
			});
			settext=settext.replace(/\#/g,"%23");
			submitform(modules["set_data"],settext);
		}else {
			settext="&id179="+$("[name=id179]").val();
			submitform(modules["set_data"],settext);
		}
	});
}

function read() {
	if($("[name=id179]").val()!=='1000') {
		$("input:text").attr('readonly',true);
		$("input:text").css('background','#EEEEEE');
	}else {
		$("input:text").attr('readonly',false);
		$("input:text").css('background','#fff');
	}
}

function change179(nonames) {
	var gettext ='&country_id='+$("select[name=id179]").val()+'&id=4007';
	DataRequest("get_json",gettext,function(data){
  		getResult(nonames,data);
  	});
	read();
}
</script>
